package com.asiainfo.complier.ui;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class JRoundButton extends JLabel {

	/**
	 * JRoundButton
	 */
	private static final long serialVersionUID = -8629673248089499254L;
	private Color borderColor = new Color(0xB2, 0xB9, 0xC1);

	public JRoundButton(String title) {
		super(title);
		setHorizontalAlignment(JLabel.CENTER);
		this.setPreferredSize(new Dimension(80, 26));
		this.addMouseListener(new MouseListener() {

			public void mouseReleased(MouseEvent e) {
				setBorder(new ColorBorder(borderColor));
			}

			public void mousePressed(MouseEvent e) {

			}

			public void mouseExited(MouseEvent e) {
				setBorder(new ColorBorder(borderColor));
				setForeground(Color.black);
			}

			public void mouseEntered(MouseEvent e) {
				setBorder(new ColorBorder(Color.green));
				setForeground(Color.red);

			}

			public void mouseClicked(MouseEvent e) {

			}
		});
		this.setBorder(new ColorBorder(borderColor));
	}

}
